package cn.edu.scau.cmi.wujiaxian.exercise8;

interface SpeakHello {
	void speak();
}

class HelloMachine {
	public void turnOn(SpeakHello hello) {
		hello.speak();
	}
}

public class Example8_3 {
	
	public static void main(String[] args) {
		HelloMachine machine = new HelloMachine();
		machine.turnOn(new SpeakHello() {
			public void speak() {
				System.out.println("Hello, you are welcome!");
			}
		});
		machine.turnOn(() -> {
			System.out.println("你好，欢迎光临！");
		});
	}
	
}
